﻿using System;
using System.Windows.Forms;

namespace TextEditor
{
   

    public class A_InsertKB : A_Action
    {
        public A_InsertKB()
        {
            base.HotKey = Keys.F9;
        }

        public override string ActionName()
        {
            return "insertkb";
        }

        public override bool Execute()
        {
            base.myOwnerDocument._InsertKB(false);
            return true;
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.CanModify();
        }

        public override bool TestHotKey(Keys vKeyCode, bool vShift, bool vControl, bool vAlt)
        {
            if (vShift)
            {
                vKeyCode |= Keys.Shift;
            }
            if (vControl)
            {
                vKeyCode |= Keys.Control;
            }
            if (vAlt)
            {
                vKeyCode |= Keys.Alt;
            }
            return ((vKeyCode == (Keys.Control | Keys.K)) || (vKeyCode == Keys.F8));
        }
    }
}

